home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / ifo_audio.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-05-06  |  1.5 KB  |  64 lines

  1.  
  2. /*
  3.  * GET AUDIO INFORMATION
  4.  *
  5.  * Copyright (C) 1998,1999,2000  Thomas Mirlacher
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  * 
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  * 
  21.  * The author may be reached as dent@cosy.sbg.ac.at, or
  22.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  23.  * Austria
  24.  *
  25.  *------------------------------------------------------------
  26.  *
  27.  */
  28.  
  29.  
  30. #include <stdlib.h>
  31. //#include <sys/types.h>
  32. //#include <unistd.h>
  33. #include "ifo.h"
  34.  
  35. #include "misc.h"
  36. #include "decode.h"
  37.  
  38. /*
  39.  audio_struct [1..8] audio_table_struct
  40. */
  41.  
  42. typedef struct {
  43.     u_int    foo        : 16;    // ???
  44.     u_int    num        : 16;    // number of subchannels
  45. } audio_hdr_t;
  46.  
  47. #define AUDIO_HDR_LEN 4
  48.  
  49. /**
  50.  *
  51.  */
  52.  
  53. int ifoGetAudio (char *_hdr, char **ptr)
  54. {
  55.     audio_hdr_t *hdr = (audio_hdr_t *) _hdr;
  56.  
  57.     if (!_hdr)
  58.         return -1;
  59.  
  60.     *ptr = _hdr + AUDIO_HDR_LEN;
  61.  
  62.     return bswap_16 (hdr->num);
  63. }    
  64.